from rest_framework import permissions

import user.models


class CustomerPermission(permissions.BasePermission):
    def has_permission(self, request, view):
        if request.user.user_type == user.models.CUSTOMER:
            return True
        return False


class RiderPermission(permissions.BasePermission):
    def has_permission(self, request, view):
        if request.user.user_type == user.models.RIDER:
            return True
        return False


class ShopPermission(permissions.BasePermission):
    def has_permission(self, request, view):
        if request.user.user_type == user.models.SHOP:
            return True
        return False
